<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../layout/tag-lib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="../layout/html-head.jsp" %>
    <script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
    <style>
        .row{
            margin-top:15px;
        }
        label{
            min-height: 30px;
            line-height: 30px;
            font-size:12px;
        }
        .span1{
            text-align:right;
        }
        .row input{
            width:190px;
        }
        .row select{
            width:205px;
        }
    </style>
</head>
<body>
<jsp:include page="../layout/nav.jsp">
    <jsp:param name="menu" value="userList"/>
</jsp:include>
<div class="main-content">
    <div class="page-content" class="page-content">
        <h3 class="header smaller lighter blue">用户信息查询</h3>
        <form method="post" action="/searchUser">
            <div class="row" style="margin-left:0px">
                <div class="span1"><label for="username">用户名称:</label></div>
                <div class="span3"><input type="text" id="username" name="username" value="${param.username}"></div>
                <div class="span1"><label for="phoneNum">手机号码:</label></div>
                <div class="span3"><input type="text" id="phoneNum" name="phoneNum" value="${param.phoneNum}"></div>
            </div>
            <input style="width:100px;" type="submit" class="ace-icon fa fa-search nav-search-icon pull-right" value="查询" />
        </form>
        <h3 class="header smaller lighter blue">查询结果</h3>
        <table id="repairListTable" class="table table-striped table-hover">
            <thead>
            <tr>
                <th style="text-align:center;">用户名称</th>
                <th style="text-align:center;">用户头像</th>
                <th style="text-align:center;">手机号码</th>
                <th style="text-align:center;">联系地址</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${page.items}" var="user">
                <tr>
                    <td style="text-align:center;height: 50px; line-height: 50px">${user.username}</td>
                    <td style="text-align:center;height: 50px; line-height: 50px">
                        <c:choose>
                            <c:when test="${user.userpic != null && user.userpic ne ''}">
                            <img  style="height: 50px; line-height: 50px" src="/imgFile?fileName=${user.userpic}"/>
                        </c:when>
                            <c:otherwise>
                                <div></div>
                            </c:otherwise>
                        </c:choose>
                    </td>
                    <td style="text-align:center;height: 50px; line-height: 50px">${user.phoneNum}</td>
                    <td style="text-align:center;height: 50px; line-height: 50px">${user.address}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <div style="width:260px;margin: 0 auto; " class="pagination pagination-small pagination-right">
            <span style="float:right; padding-top:1px;padding-left:20px;">${page.currentPage}/${page.pageCount}</span>
            <ul>
                <li><a href="javascript:void(0);" onclick="toPage(1);">首页</a></li>
                <li><a href="javascript:void(0);" onclick="toPage(${page.currentPage <= 1 ? 1 : (page.currentPage - 1)});">上一页</a></li>
                <li><a href="javascript:void(0);" onclick="toPage(${page.currentPage >= page.pageCount ? page.pageCount : (page.currentPage + 1)});">下一页</a></li>
                <li><a href="javascript:void(0);" onclick="toPage(${page.pageCount});">末页</a></li>
            </ul>
        </div>
        <form name="helpForm" id="helpForm" method="post" action="/searchUser">
            <input type="hidden" name="pageNo" value="" />
            <input type="hidden" name="username" value="${param.username}" />
            <input type="hidden" name="phoneNum" value="${param.phoneNum}" />
        </form>
    </div>
</div>
<jsp:include page="../layout/footer.jsp"/>
<script type="text/javascript">


    function toPage(pageNo) {

        $("input[type=hidden][name=pageNo]").val(pageNo);
        $("#helpForm").submit();
    }



</script>

</body>
</html>